#ifndef LoggerH
#define LoggerH
#include "Singleton.h"


namespace myCBIR
{
    using namespace std;

    class Logger : public Singleton <Logger>
    {
        private:
            Logger() : Singleton<Logger>() {}

        protected:
            friend class Singleton<Logger>;

        public:
            void log(const std::string& logMessage) const
            {
                std::cerr <<  logMessage << std::endl;

                const std::string logFile = "log.txt";
                std::ofstream f(logFile.c_str(), std::ios::app);
                f << logMessage << std::endl;
            }
    };

}

#endif
